<CheckboxList TModel="Foo" TValue="string" @bind-Value="@Value1" Items="@Items1"
              OnSelectedChanged="@OnSelectedChanged"
              ValueField="Value" TextField="Text" CheckedField="Checked"></CheckboxList>

@code {
    private class Foo
    {
        public string Text { get; set; } = "";

        public int Value { get; set; }

        public bool Checked { get; set; }
    }

    /// <summary>
    /// 
    /// </summary>
    private IEnumerable<Foo> Items1 { get; set; } = new List<Foo>()
    {
        new Foo { Text = "Item 1", Value = 1, Checked = true },
        new Foo { Text = "Item 2", Value = 2, Checked = false },
        new Foo { Text = "Item 3", Value = 3, Checked = true },
        new Foo { Text = "Item 4", Value = 4, Checked = false }
    };

    private string Value1 { get; set; } = "1,3";

    private Task OnSelectedChanged(IEnumerable<Foo> items, Foo foo, string value)
    {
        Trace?.Log($"{foo.Text} - {foo.Checked} Value: {foo.Value} 共 {items.Where(i => i.Checked).Count()} 项被选中 组件绑定值 value：{value}");
        Trace?.Log($"组件绑定值 Value1：{Value1}");

        return Task.CompletedTask;
    }
}
